<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:a4j="http://richfaces.org/a4j" xmlns:rich="http://richfaces.org/rich">
 <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
 </head>
    <ui:composition template="/template/template.xhtml">
    	<ui:define name="conteudo">
    		<div id="body-left">
					<h:panelGroup rendered="#{sessionScope.usuario != null}">
						<h2>
							<h:outputText value="#{msgs.bemvindo}, #{sessionScope.usuario.nome}" />
						</h2>
						<div style="text-align: justify;">
							<p>
								<h:outputLink value="opcoes.jsf">
									<h:outputText value="#{msgs.opcoes}" />
								</h:outputLink>
							</p>
							<p>
								<h:form>
									<h:commandLink action="#{loginUsuarioBean.logoff}">
										<h:outputText value="#{msgs.sair}" />
									</h:commandLink>
								</h:form>
							</p>
						</div>
					</h:panelGroup>
					<h2><h:outputText value="#{msgs.novosalbuns}" /></h2>
					<rich:dataTable value="#{indexBean.ultimosAlbuns}" id="ultimosalbuns" var="album">
						<rich:column>
							<div class="coment">
								<table class="info">
									<tr>
										<td rowspan="3" style="border-right:solid 1px #cccccc">
											<!-- link pra pagina do album -->
											<h:outputLink value="album.jsf?id=#{album.id}" title="#{msgs.irparaalbum}">
												<h:graphicImage url="#{album.imagem}" width="80" height="80"/>
											</h:outputLink>
										</td>
										<th><h:outputText value="#{msgs.album}" /></th><td class="dados"><h:outputText value="#{album.nome}" /></td>
									</tr>
									<tr>
										<th><h:outputText value="#{msgs.ano}" /></th><td class="dados"><h:outputText value="#{album.ano}" /></td>
									</tr>
									<tr>
										<th><h:outputText value="#{msgs.artista}" /></th><td class="dados"><h:outputText value="#{album.artista.nome}" /></td>
									</tr>
								</table>
							</div>
						</rich:column>
						
					</rich:dataTable>
				</div>
				<div id="body-right">
					<h2><h:outputText value="#{msgs.ultimasmusicas}" /></h2>
					<rich:dataTable value="#{indexBean.ultimasAdicionadas}" id="ultimasmusicas" var="musica">	
						<rich:column style="height:100px" styleClass="musica">
							<div class="box">
								<h:outputLink value="album.jsf?id=#{musica.album.id}">
									<h:graphicImage url="#{musica.album.imagem}" width="100" height="100" alt="Pic 1" class="left" />
								</h:outputLink>
									<table class="info">
										<tr>
											<th><h:outputText value="#{msgs.categoria}" /></th><td><h:outputText value="#{musica.categoria.nome}" /></td>
										</tr>
										<tr>
											<th><h:outputText value="#{msgs.artista}" /></th><td><h:outputText value="#{musica.album.artista.nome}" /></td>
										</tr>
										<tr>
											<th><h:outputText value="#{msgs.musica}" /></th><td><h:outputText value="#{musica.nome}" /></td>
										</tr>
									</table>
									<div class="btns">
										<h:outputLink value="musica.jsf?id=#{musica.id}">
											<h:outputText value="#{msgs.escutar}" />
										</h:outputLink>
									</div>	
							</div>
						</rich:column>
					</rich:dataTable>
				</div>
				<div class="clear"></div>
		</ui:define>
    </ui:composition>
</html>